<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>商家列表</title>
		<link rel="stylesheet" href="__OEM__/css/iconfont.css" />
		<link rel="stylesheet" href="__OEM__/css/css.css" />
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right">
					<!--右侧内容-->
					<div class="rigtop">
						<span class="title">商家列表</span>
					</div>
					<div class="indrig_con" style="position: relative;">
						{if $Think.session.user_level==3 && $Think.session.user_type==1}
						<div class="zizh_btnbox" style="top: -58px;right:30px">
							<button class="zizh_btn" type="button"><i class="iconfont icon-jia"></i>创建商户</button>
						</div>
						{/if}
						<div class="zizh_conbox" style="padding-top: 20px;">
							<!--选项卡内容开始-->
							<div class="huizcx_top">
								<div class="chax_rowbox2 clearfix">
									<form id="my_form" action="{:url('oem/accounts/agent')}" method="post">
										<div class="shxx_row chax_row clearfix">
											<div class="left">店铺名称：</div>
											<div class="right clearfix">
												<input type="text" name="agent_name" id="agent_name" value="{$agent_name}" placeholder="店铺名称" class="chax_input" />
											</div>
										</div>
										<div class="shxx_row chax_row clearfix">
											<div class="left">手机号码：</div>
											<div class="right clearfix">
												<input type="text" name="mobile" id="mobile" value="{$mobile}" placeholder="手机号码" class="chax_input" />
											</div>
										</div>
										<div class="shxx_row chax_row clearfix">
											<button type="submit" class="htcxbtn">查询</button>
										</div>
								</div>
								</form>
								<div class="chax_conbox">
									<div class="chax_jiegbt clearfix">
										<div class="chax_jieg">总计：{$list->total();}家</div>
										<div class="chax_xzbtnbox">
											<a href="javascript:;" onclick="check()"><i class="iconfont icon-download"></i>商家下载</a>
										</div>
									</div>
									<div class="chax_jiegnr">
										<table class="zizh_table1 zizh_table2">
											<thead>
												<tr>
													<th>店铺名称</th>
													<th>手机号码</th>
													<th style="width: 30px;">费率</th>
													<th style="width:60px;">资质认证</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody id="tbody">
												{volist name="list" id="vo" empty="$empty"}
												<tr>
													<td>{$vo.agent_name}</td>
													<td>{$vo.mobile}</td>
													<td>{$vo.cb_huilu}%</td>
													<td>{if $vo.is_state==1}已签约{else}未签约{/if}</td>
													<td>
													{if($Think.session.user_level==3)}
													<a href="javascript:;" onclick="upagent_huilv('{$vo.id}')">修改银行费率</a>
													{/if}
													<a href="javascript:;" onclick="show_agent('{$vo.id}')">详情</a>
													{if($Think.session.user_level==3)}
														{if condition="$vo.is_state == 1"}
														<a href="{:url('index/qianyue_step5',['agent_id'=>$vo.id])}">查看资料</a>
														{else /}
														<a href="{:url('index/qianyue_step1',['agent_id'=>$vo.id])}">去签约</a>
														{/if}
													{/if}
													</td>
												</tr>
												{/volist}
										</table>
									</div>
								</div>
							</div>
						</div>

					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}

	</body>
	<script>
		$(".zizh_btn").click(function() {
			layer.open({
				type: 2,
				title: '添加商家',
				shadeClose: true,
				shade: 0.8,
				area: ['800px', '700px'],
				content: "{:url('accounts/add_agent')}"
			});
		})

		function show_agent(id) {
			var url = 'show_agent?id=' + id;
			layer.open({
				type: 2,
				title: '商家详情',
				shadeClose: true,
				shade: 0.8,
				area: ['500px', '500px'],
				content: [url]
			});
		}

		function check() {
			var agent_name = $('#agent_name').val();
			var mobile = $('#mobile').val();
			window.location.href = "/oem/accounts/agent_dcxml.html?agent_name=" + agent_name + "&mobile=" + mobile;
		}
	function upagent_huilv(id){
		var url='upagent_huilv?id='+id;
		layer.open({
		  type: 2,
		  title: '修改商家费率',
		  shadeClose: true,
		  shade: 0.8,
		  area: ['500px', '	220px'],
		  content:  [url]
		}); 
	}
	</script>

</html>